import type {  FormField } from '@/components'
import { getTree } from '@/api/systemSetting/personnel'
import { ref } from 'vue'
getTree({ remark: 'zgdw' }).then((res: any) => {
  // fields.value.find((item) => item.key === 'supervisoryCode')!.attrs!.data = res.data
  fields.value.find((item) => item.key === 'supervisoryCode')!.attrs!.data = res.data
})

export const fields = ref([
    {
    key: 'examineYear',
    label: '年检年份',
    tag: 'el-date-picker',
    placeholder: '请选择年检年份',
    attrs: {
      style: {
        width: '180px',
      },
      type: 'year',
      valueFormat: 'YYYY'
    }
  },{
    key: 'organizationBaseName',
    label: '组织名称',
    tag: 'ElInput'
  },
  {
    key: 'organizationType',
    label: '组织类型',
    tag: 'MRadioButtonGroup',
    attrs: {
      options: [
        {
          label: '不限',
          value: ''
        },
        {
          label: '社团',
          value: '1'
        },{
          label: '民非',
          value: '2'
        }
      ]
    }
  },
  {
    key: 'needInspect',
    label: '是否应当参检',
    tag: 'MRadioButtonGroup',
    attrs: {
      clearable: true,
      options: [
        {
          label: '不限',
          value: ''
        },
        {
          label: '是',
          value: '1'
        },{
          label: '否',
          value: '0'
        }
      ]
    }
  },  {
    key: 'supervisoryCode',
    label: '主管部门',
    tag: 'MTreeSelect',
    attrs: {
      data: [],
      fields: {
        value: 'deptId',
        label: 'deptName',
        children: 'children'
      }
    }
  }
])
export const modelValue = {
  examineYear: new Date().getFullYear()-1 + '',
  needInspect: '',
  organizationBaseName: '',
  organizationType: '',
  supervisoryCode: '',
}


